package com.ingesup.services;

import java.util.List;

import org.springframework.flex.remoting.RemotingDestination;
import org.springframework.stereotype.Service;

import com.ingesup.dao.ListeDeDiffusionDao;
import com.ingesup.dao.ListeDeDiffusionDaoImpl;
import com.ingesup.entities.ListeDeDiffusion;

/**
 * @author FDEJEAN
 */

@Service
@RemotingDestination("listeDeDiffusionService")
public class ListeDeDiffusionServiceImpl implements ListeDeDiffusionService {

	private static ListeDeDiffusionDao dao;
	
	static {
		dao = new ListeDeDiffusionDaoImpl(ListeDeDiffusion.class);
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public ListeDeDiffusion createListeDeDiffusion(ListeDeDiffusion toCreate) {
		return dao.create(toCreate);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void updateListeDeDiffusion(ListeDeDiffusion toUpdate) {
		dao.update(toUpdate);		
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void deleteListeDeDiffusion(ListeDeDiffusion toDelete) {
		dao.delete(toDelete);		
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public ListeDeDiffusion getListeDeDiffusion(long id) {
		return dao.read(id);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public List<ListeDeDiffusion> getListListeDeDiffusion() {
		return dao.getAll();
	}

}
